      <form action="">
        <input type="text" id="fname" value="<?=$name ?>" /><br/>
        <input type="text" id="flink" value="<?=$permalink ?>" /><br/>
        <input type="button" id="save" value="Save" onclick="tagsave();" />
        <div id="names">
    <?php if (!empty($elem)) foreach($elem as $e): ?>
    <div class="tag round2" id="<?=$e->id ?>" tag="<?=$e->name ?>">
      <span
      onclick="select(this.parentNode);"
      ondblclick="$(this.parentNode).hide();" >
      <?=$e->name ?>
      </span>
      <a href="javascript:void(0);" onclick="swtch(this.parentNode);">&larr;</a>
      <span class="x" onclick="tagdel(<?=$e->id ?>);">X</span>
    </div>
    <?php endforeach; ?>        </div>
      </form>